package HomeWork.Chapter03;

import java.util.*;

/**
 * Enjoy programming!!!
 * Time: 2021/11/4 -  20:27
 */
public class CommonDivisor06 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();//其中一个
        int b = in.nextInt();//另一个
        int a1 = a;//求公倍数会再次用到a，b，这里要先把他们记录下来
        int b1 = b;
        int temp;
        int temp1;
        while (true) {//求最大公约数
            if (a < b) {
                temp1 = a;
                a = b;
                b = temp1;
            }
            temp = a % b;
            if (0 != temp) {
                b = temp;
                a = b;
            } else {
                System.out.println("最大公约数是：" + b);
                break;
            }
        }
        int multiple;
        multiple = a1 * b1 / b;
        System.out.println( "最小公倍数是：" + multiple);
    }
}
